#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
微信机器人启动脚本
"""

import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

from src.core import WeChatRobot
from src.config import ConfigManager


def main():
    """主函数"""
    print("🤖 微信机器人启动器")
    print("="*30)
    
    try:
        # 初始化配置管理器
        config_manager = ConfigManager()
        
        # 创建机器人实例
        robot = WeChatRobot(config_manager)
        
        # 运行机器人
        success = robot.run()
        
        if success:
            print("✅ 机器人执行成功")
        else:
            print("❌ 机器人执行失败")
            
    except KeyboardInterrupt:
        print("\n⚠️ 用户中断执行")
    except Exception as e:
        print(f"❌ 发生错误: {e}")


if __name__ == '__main__':
    main()
